package com.yootk.service;

import com.yootk.common.dto.DeptDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

@Component
@Slf4j // 进行日志的输出
public class DeptMessageListener { // 部门消息监听
    @StreamListener(Sink.INPUT) // 绑定SCS的消费注解
    public void receive(Message<DeptDTO> message) { // 实现消息监听处理
        log.info("接收到消息内容：{}", message.toString());
    }
}
